home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1999 #2
/
Amiga Plus CD - 1999 - No. 2.iso
/
System-Boost
/
Grafik
/
MetaView
/
ARexx-Examples
/
WordWorth_Import_Gfx.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1998-11-08
|
2KB
|
77 lines
/* Graphik Import in WordWorth mittels MetaView */
METAVIEW = ':Aminet/MetaView/MetaView' /* Please complete the path */
OPTIONS RESULTS
SIGNAL ON FAILURE
SIGNAL ON SYNTAX
/*
** Looking for our start process
*/
WWPORT = ADDRESS()
say WWPORT
if (LEFT(WWPORT, 9) ~= "WORDWORTH") then do /* not started from WordWorth */
say "Please start me from WordWorth!"
EXIT
end
/*
** Create a new Metaview process:
** first look for the allready running processes
** then the new Port will be the next one
*/
do NUMBER = 0 to 20
if (SHOW(PORTS,"METAVIEW." || NUMBER) = 0) then
leave
end
/*
** Searching for MetaView: 1. our path above,
** 2. path in env:MetaView.path
** or 3. you must have a assign "MetaView:"
*/
if (EXISTS(METAVIEW)=0) then do
if OPEN("MVVAR","env:MetaView.path","Read") then do
METAVIEW = READLN("MVVAR")
end
if (EXISTS(METAVIEW)=0) then do
METAVIEW = "MetaView:MetaView"
end
end
OPTIONS FAILAT 5 /* enable warnings for WaitForPort */
ADDRESS COMMAND
"run " || METAVIEW || " NODISPLAY"
MVPORT = "METAVIEW." || NUMBER
"WaitForPort " || MVPORT
OPTIONS FAILAT 21 /* ignore errors */
ADDRESS VALUE WWPORT
REQUESTFILE PATH "Bilder:" TITLE "Please select GFX file"
FILENAME = result
ADDRESS VALUE MVPORT
LOAD FILENAME
SAVE "t:test.cgm" AS CGM
QUIT
ADDRESS VALUE WWPORT
REQUESTNOTIFY PROMPT "Please select >t:test.cgm<."
PLACEPICTURE
EXIT
FAILURE:
ADDRESS VALUE WWPORT
REQUESTNOTIFY PROMPT "Can't find" METAVIEW "!"
EXIT
SYNTAX:
say "Error on line" SIGL ":" ERRORTEXT(RC) "!"
EXIT